1. Field of the Invention
The present invention relates generally to a database system for handling multimedia data such as image data, voice data, movie data and the like, and more particularly to a variable-length database storing method and apparatus which can perform addition, change and deletion of data during operation of the database system, and which do not need to reconstruct the composition of the database.
2. Prior Art
A database stores various kinds of data made to correspond to other data, and retrieves and outputs desired data at need. A conventional database consists of a database having data stored in it, a database managing system for reading and writing data from and into the database, a server or other suitable computer system for operating and managing the database, and applications realizing various functions using the database on the server/computer system.
At present relational databases are in common use. The relational database makes every data relate to other data using a table, and forms and stores those relations into a table. Data typically is stored in a specified length, in a specified type, in a specified area and in specified order. In a conventional database structure, the length of a record or an item of managed data typically is fixed. Therefore, if the compatibility of data is not kept, an error may occur, causing the database or a program accessing the database to abort. When a database definition or structure is modified, it causes the data in the database to be incompatible with the database. Thus, the data needs to be modified, so that it is compatible with the database. This can be very time consuming.
As one skilled in the art will appreciate, multimedia files are managed as binary large object (BLOB) types, or managed by means of a method of storing the data as an external file and making them correspond to their file name. Therefore, the database has no consistency, has been complicated in management, and is poor in system efficiency.
With rapid advance of information technology (IT), various social activities or economic activities utilizing IT have become more and more common. Further, with the development of data processing apparatuses and communication technologies, various types of data have come into use. In such an environment, the importance of establishing a method for efficiently handling an enormous amount of data is becoming a higher priority.
Since many databases are customized for specific operations or services, a large amount of work is required to perform this customization.
A table in a database is managed in a state where data having a fixed record length or a fixed item data length are put close in a regular order. In order to access a desired record, it is necessary to calculate the address of a record stored, determine the location of the record and access the record. Accordingly, it is necessary that the structure of the data be fixed.
Due to such a structure, when registration of an item is changed, if all relevant records are not changed, the compatibility of data is lost and a database table becomes inaccessible. In order to reconstruct a database to maintain the compatibility of data, it has been necessary to interrupt the use of the database system.
As a result, it has become necessary to handle data that varies significantly in length such as multimedia data. On setting the length of data, the maximum possible length of data in ordinarily used applications is set and defined. A table can quickly become redundant, the efficiency of utilizing resources becomes poor, and management of the database becomes laborsome. Therefore, an object-oriented database is also conceived in order to handle multimedia data, but is different in structure from commonly used databases. Accordingly, it has been difficult to incorporate such a database into a conventional database.
Furthermore, with the spread of the Internet, there has been increased use of languages such as XML (Extensible Markup Language) or the like, which has excellent compatibility with the Internet. A conventional database cannot cope with a flexible item definition and a structured data structure by means of XML. It needs to redefine a table or a structure each time the definition of XML is performed. Each time, it is necessary to stop and reconstruct a database system.
The present invention has been performed in consideration of such circumstances, and in one embodiment of the present invention there is provided a database apparatus and a database accessing method for managing very long data having variable-length records and variable-length items by means of a single table.
Further, in another embodiment of the present invention there is provided a database apparatus capable of performing additions or changes of data without reconstructing a database when attempting to modify the database with the modification of items of a table or specifications of a record.
In order to solve the previously mentioned problems of a conventional database structure, the present invention makes it possible to handle items and record data of variable length. There is provided in accordance with the present invention, a database apparatus for storing variable-length data items. The apparatus includes an inputting portion for receiving a data item to be written into the database and for receiving a retrieval condition when a data item is to be read from the database, an outputting portion for outputting data items read from the database, a database management system for controlling the writing and reading of the data items, and a data store. Each data item is stored in the form of one or more data packets.
The data store has an item definition area, a record management area, and a data area. The item definition area stores, in connection with each data item, a data item name, data item type (e.g., category such as text or image), and data item length. The item definition area also stores a packet address (number) assigned to each data item. The record definition area manages records and assigns a packet address to each record, the record comprising a plurality of data items related to each other and defined by said item definition area. The data area stores the actual data items.
The database management system retrieves a data item from the data store when a retrieval condition inputted at the inputting portion matches data in the item definition area and the record management area, resulting in the retrieved data item being provided to the outputting portion.
In another embodiment, there is provided a variable-length database apparatus with an inputting portion for inputting stored data and a retrieval condition, a database for storing data inputted by said inputting portion in it, a database management system for reading and writing data from and to said database, and an outputting portion for outputting the result of retrieving data stored in said database, comprising:
a means for generating an item definition area for relating to each other and storing in it the item name, data type, and item length of each item data defined in said database, and the packet number given to said item;
a means for generating a record management area for giving a packet number to a record consisting of items defined by said item definition, and relating to each other and storing them in it;
a means for generating a data area by referring to other data inputted by said inputting portion and said record management area;
an extracting means for extracting, when data inputted by said inputting portion and data in said record management area are matched with a retrieval condition in retrieval of data, the matched data from said data area; and
an outputting means for outputting the data extracted by said extracting means.
Hereupon, said database is comprised of said item definition area formed out of variable-length data, said record management area and said data area. Said data typically has a length and type optionally set for each data.
The database apparatus has a means for forming each of said item definition area, said record management area, and said data area out of independent packets managed by a node descriptor and a node allocation table. Said database has a means provided with a node allocation table for managing the address of said packet. Said database also has a means for managing the basic information, location, and size of a record. It is provided with a means for storing data extracted and outputted by a process of extracting said data from said data area and a means for outputting the extracted data, and further a means for displaying said extracted and outputted data.
Each of the data tables of said item definition area, said record management area and said data area is composed of a plurality of packets and clusters, and said data table is accessed in packets.
The first packet of the first cluster of said data table typically is a table control packet. The forefront packet of the second or following cluster is a packet control table showing a use state of a packet.
The size of said packet is an integral multiple of 256 bytes. The number of packets contained in said cluster is 8n when the size of a packet is n bytes. The size of said cluster is 8n2 bytes when the size of a packet is n bytes.
In an event where the data size of a record is larger than the size of a packet, a means for dividing and storing the record into plural packets is provided. A means for indirectly referring to the relevant packet in addressing said divided and stored data is provided. Said indirect addressing process is performed by a means for referring to the relevant packet by means of a packet address managed by a node allocation table specified by said node descriptor.
A means for managing a process of indirectly addressing a record of up to n2/8 bytes when one packet is of n bytes in said addressing is provided. A means capable of managing a one-stage or more-stage indirect addressing process in the event that the size of a record is not smaller than the size of said packet in said addressing is provided. A means in which said packets are independent and not restricted by the continuity or the location of each packet stored on a file is provided.
Further, the present invention comprises a variable-length database accessing method for inputting stored data and a retrieval condition for storing inputted data, and outputting the result of retrieved data stored in said database, comprising:
a process of generating an item definition area for relating to other definition areas and storing the item name, data type, and item length of each item defined in said database, and the packet number given to said item;
a process of generating said record management area for giving a packet number to a record composed of items defined by said item definition and for relating to other item definitions, and storing them; and
a process of generating a data area by referring to other data inputted by said inputting portion and said record management area.
Said method further comprises;
a process of extracting, when data inputted by said inputting portion and data in said record management area are matched with a retrieval condition in retrieval of data, the matched data from said data area; and
a process of outputting said extracted data.
This method has a process of forming said item definition areas, said record management areas, and said data areas out of a data table composed of independent packets managed by the node descriptor and the node allocation table.
Said data typically has a length and type optionally set for each data. Said database has a process of being provided with the node allocation table for managing the address of said packet and the node descriptor for managing the basic information, location, and size of a record. A process of forming said item definition areas, said record management areas, and said data areas out of a data table composed of independent packets managed by the node descriptor and the node allocation table is provided. A data table is composed of a plurality of packets and clusters, wherein said data table is accessed in packets. The first packet of the first cluster of said data table is a table control packet. The forefront packet of the second or following cluster is a packet control table showing a use state of a packet.
In an event where the data size of a record is larger than the size of a packet, the record is divided and stored into plural packets. A process of indirectly referring to a packet when addressing said divided and stored data is provided. Said indirect addressing process is performed by referring to the relevant packet by means of said packet address managed by a node allocation table specified by said node descriptor.
A means for managing a process of indirectly addressing a record of up to n2/8 bytes when one packet is of n bytes in said addressing is provided. In the event that the size of a record is not smaller than the size of said packet in said addressing, a one-stage or more-stage indirect addressing process may be managed.
Said packets are typically independent and therefore not restricted by the continuity or the location of each packet stored in a file. Consequently, it is possible to add or change an item.
Further, said database may automatically determine and register the type of multimedia data utilizing the Internet at said database.
A variable registered item and variable-length database system of the present invention makes it possible to handle an item definition structure, a record structure, and a data record as variable-length data by managing the whole file as an aggregate of packets.
When addition, change, deletion or the like of an item or record occurs, inputting the relevant data each time is usually sufficient. The inputted data are processed in packets, and are related and stored without being restricted by the length or location of the data. Since a database system of the present invention may store inputted data consecutively, it may cope with processing huge data using the Internet which will be utilized more frequently.
The present invention is typically used to change the structure of a database or efficiently manage very long multimedia data as keeping the system operated. A variable-length database of the present invention is capable of coping with a new flexible data structure of XML or the like having a flexible data structure so as to adapt to a system capability required for a future information environment.